<?php
/**
 * @filesource					RoleModel.class.php
 * @desc						用户角色管理模型类			
 * 
 * @author						houyining
 * @copyright					hou.yining@gmail.com	
 * @date						2011-04-21
 */


class RoleModel extends Model{
	//用户角色暂时不需要层级关系
	protected $_auto = array(
		array('pid', 	0),
		array('status',	1),
	);
	
	/** 
	 *获取制定角色的所有用户
	 *
	 *@param $role_id
	 *@return array(id, user_name)
	 */
	public function getUserList($role_id){
		$table = $this->tablePrefix.'role_user';
		$rs = $this->db->query('select b.id from '.$table.' as a ,'.$this->tablePrefix.'admin_user as b where a.user_id=b.id and  a.role_id='.$role_id.' ');
		return $rs;
	}
}
?>